/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-03
 * Time: 18:43
 */
sealed class Animal permits Dog,Cat,Duck {

}
non-sealed class Dog extends Animal {

}
final class Cat extends Animal {

}
sealed class Duck extends Animal{

}
final class A

class MyArray {
    public static <E> E getValue(E[] array,int pos) {
        return array[pos];
    }
}
public class Test {
    public static void main(String[] args) {
        String[] strings = new String[4];
        strings[0] = "dings";
        strings[1] = "hua";
        strings[2] = "per";
        strings[3] = "wow";
        String tmp = MyArray.getValue(strings,1);
        System.out.println(tmp);
    }
    public static void main2(String[] args) {
        Integer[] array1 = new Integer[4];
        array1[0] = 0;
        array1[1] = 1;
        array1[2] = 2;
        array1[3] = 3;
        /*MyArray myArray = new MyArray();
//      Integer tmp = myArray.<Integer>getValue(array1,0);*/
        for (int i = 0; i < array1.length; i++) {
            Integer tmp = MyArray.getValue(array1,i);
            System.out.println(tmp);
        }
    }
    public static void main1(String[] args) {
        Integer[] array1 = new Integer[4];
        array1[0] = 0;
        array1[1] = 1;
        array1[2] = 2;
        array1[3] = 3;
        MyArray myArray = new MyArray();
//      Integer tmp = myArray.<Integer>getValue(array1,0);
        for (int i = 0; i < array1.length; i++) {
            Integer tmp = myArray.getValue(array1,i);
            System.out.println(tmp);
        }
    }

}
